package com.demo;


import java.util.*;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.stream.Collectors;

public class TestDemo {
    public static int k = 3;

    public static void main(String[] args) {





















       /* Map<String,String> map=new HashMap<>(100);

       List<Per> list1= Arrays.asList(
               new Per("a",90),
               new Per("a",100),
               new Per("c",85),
               new Per("c",33),
               new Per("e",60),
               new Per("f",70),
               new Per("g",10),
               new Per("h",77)
       );
       List<Per> list=new ArrayList<>(list1);

        Map<String, List<Per>> collect = list.stream()
                .collect(Collectors.groupingBy((p)->{
                    if(p.getAge()>=60){
                        return "优秀";
                    }else{
                     return "一般";
                    }
                }));

        System.out.println(collect);*/

        MyThread1 myThread=new MyThread1();
        for(;;){
            new Thread(myThread).start();
        }
    }
}
 class  MyThread1 implements Runnable{
     public void run() {
         get();
     }
     public synchronized void get(){
         System.out.println(Thread.currentThread().getName());
         set();
     }
     public synchronized void set(){
         System.out.println(Thread.currentThread().getName());
     }
 }

class Per {
    private String name;
    private int age;

    public Per(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Per{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}